UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gGDxuaxB/LwCGUqRbDu3ci8OaCNxM08/2tCkBJmnaCk=' 
WHERE 
  key_id = '4237d799c5acad2a20055005e310587ce491a30293928d557e601bb17725eac8' 
  AND (
    token = 'gGDxuaxB/LwCGUqRbDu3ci8OaCNxM08/2tCkBJmnaCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034